<!DOCTYPE html>
<html>


<!-- Mirrored from /theme/hplus/form_basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:15 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>乡土味士-后台管理中心 - 添加分类</title>
    <meta name="keywords" content="添加分类">
    <meta name="description" content="添加分类">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/css/style.min862f.css?v=4.1.0" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title" style="min-height: 65px;margin-bottom: 15px;">
                    <!--<h5><a href="<?=U('Category/index')?>" title="分类列表">分类列表</a>&#45;&#45;添加分类</h5>-->
                    <h5>
                        <a href="<?=U('Category/index')?>" title="分类列表">
                            <button type="button" class="btn btn-primary">分类列表</button>
                        </a>
                        <a href="<?=U('Category/addCate')?>" title="添加分类">
                            <button type="button" class="btn btn-primary">+添加分类</button>
                        </a>
                    </h5>
                </div>
                <div class="ibox-content">
                    <form method="post" class="form-horizontal js_form" action="<?=U('Category/addCate')?>">
                        <notempty  name="cateInfo.id">
                            <input type="hidden" name="id" value="<?=$cateInfo['id']?>">
                        </notempty >

                        <div class="form-group">
                            <label class="col-sm-2 control-label">分类名称</label>
                            <div class="col-sm-10">
                                <input type="text" name="title" class="form-control" value="<?=$cateInfo['title']?>" required>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">上级分类</label>
                            <div class="col-sm-10">
                                <select class="form-control m-b" name="pid">
                                    <option value="0">顶级分类</option>
                                    <volist name="cate_list" id="v">
                                        <option value="<?=$v['id']?>" <?=$v['id']==$cateInfo['id']?'disabled':''?><?=$v['id']==$cateInfo['pid']?'selected':''?>><?=$v['title']?></option>
                                            <notempty name="v['_child']">  <!--如果存在子集-->
                                            <volist name="v['_child']" id="val">
                                                <option value="<?=$val['id']?>" <?=$val['id']==$cateInfo['id']?'disabled':''?><?=$val['id']==$cateInfo['pid']?'selected':''?>>&nbsp;--<?=$val['title']?></option>
                                                    <notempty name="val['_child']">  <!--如果存在子集-->
                                                        <volist name="val['_child']" id="sval">
                                                            <option value="<?=$sval['id']?>" <?=$sval['id']==$cateInfo['id']?'disabled':''?><?=$sval['id']==$cateInfo['pid']?'selected':''?>>&nbsp;&nbsp;---<?=$sval['title']?></option>
                                                        </volist>
                                                    </notempty>

                                            </volist>
                                            </notempty>
                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">类型</label>
                            <div class="col-sm-10">
                                <select class="form-control m-b" name="type">
                                    <option value="1">文章</option>
                                    <option value="2">商品</option>
                                    <option value="3">单页</option>
                                </select>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">排序</label>
                            <div class="col-sm-10">
                                <input type="text" name="displayorder" value="<?=$cateInfo['displayorder']?$cateInfo['displayorder']:'0'?>" required  class="form-control">
                                <span class="help-block m-b-none">默认为0</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">是否为前台
                            </label>
                            <div class="col-sm-10">
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" <?=$cateInfo['is_home']==1||empty($cateInfo['is_home'])?'checked=""':''?> value="1" name="is_home"> <i></i> 是</label>
                                </div>
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" <?=$cateInfo['is_home']==0&&!empty($cateInfo['is_home'])?'checked=""':''?> value="0" name="is_home"> <i></i>否</label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">状态</label>
                            <div class="col-sm-10">
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" <?=$cateInfo['status']==1||empty($cateInfo['status'])?'checked=""':''?> value="1" name="status"> <i></i> 启用</label>
                                </div>
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" <?=$cateInfo['status']==0&&!empty($cateInfo['status'])?'checked=""':''?> value="0" name="status"> <i></i>禁用</label>
                                </div>
                            </div>
                            <!--<div class="switch" style="float: left;margin-left: 15px;margin-top: 7px">-->
                                <!--<div class="onoffswitch">-->
                                    <!--<input type="checkbox" checked class="onoffswitch-checkbox" id="example1" name="status">-->
                                    <!--<label class="onoffswitch-label" for="example1">-->
                                        <!--<span class="onoffswitch-inner"></span>-->
                                        <!--<span class="onoffswitch-switch"></span>-->
                                    <!--</label>-->
                                <!--</div>-->
                            <!--</div>-->
                        </div>


                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">保存内容</button>
                                <button class="btn btn-white" type="submit">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/js/content.min.js?v=1.0.0"></script>
<script src="__PUBLIC__/js/plugins/iCheck/icheck.min.js"></script>
<script src="__PUBLIC__/js/jquery.form.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>

<script>
    //表单提交
    $(".js_form").ajaxForm({
        //定义返回JSON数据，还包括xml和script格式
        dataType: 'json',
        success: function(data) {
            //提交成功后调用
            if(data.status==1) {
                layer.msg(data.info, {icon:1,time:1000},
                    function(){
                        window.location.href= data.url;
                    });
            }else{
                layer.msg(data.info, {icon:2,time:1000});
            }
        }
    });
</script>


</body>


<!-- Mirrored from /theme/hplus/form_basic.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:15 GMT -->
</html>
